package cn.kgc.spring02.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: mosin
 * @version: v1.0  2022/11/29
 */

public class User {

    private String username;
    private Integer id;
    private Integer age;


    public User(){
        System.out.println("user对象被创建");
    }

    //全参构造
    public User(String username, Integer id, Integer age) {
        this.username = username;
        this.age = age;
        this.id = id;
    }

    public User(String username, Integer age) {
        this.username = username;
        this.age = age;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        System.out.println("username属性被赋值");
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }



    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", age=" + age +
                ", id=" + id +
                '}';
    }
}
